home *** CD-ROM | disk | FTP | other *** search
- #
- # This is a dialing script designed to work with Mindemoya Computing
- #
- # It.is designed to work with Trumpet's Winsock, Version 2.0, Rev B.
- #
- # If there are any problems, comments or suggestions, please e-mail
- # 'support@mcd.on.ca'.
- #
-
- #
- # set up some strings for dialling up
- #
-
- $modeminit = "atz"
- $userprompt = "login:"
- $passprompt = "assword:"
-
- %numberlock = 0
- %errorlimit = 4
- %diallimit = 200
- %dialtimeout = 60
-
- if ! [ load $modemsetup ]
- if [ modemsetup "Enter Modem INIT string" ]
- save $modemsetup
- end
- end
-
- if %ppp = 0
- $slipcmd = "slip"
- else
- $slipcmd = "startppp"
- end
-
- #
- # You can enter your userid and password using the 'setup' script via
- # Trumpet Winsock (you'll find it under 'Other' scripts). It will encrypt
- # your password so that it won't be evident to someone snooping around
- # your system, and will be properly loaded up here.
- #
-
- if ! [ load $username ]
- if [ username "Enter login id" ]
- save $username
- end
- end
-
- if ![ load $password ]
- if [ password "Password" ]
- save $password
- end
- end
-
- if ! [ load $number ]
- $number = $number1
- %numberlock = 0
- else
- %numberlock = 1
- end
-
- #
- #
- # initialize modem
- #
- %errors = 0
- %ok = 0
-
- display "** Initializing modem **"\n
- repeat
- outputecho $modeminit\13
- if [expect 10 "OK"]
- %ok = 1
- else
- %errors = %errors + 1
- display "** Modem is not responding! Attempt "%errors"/"%errorlimit". **"\n
- if %errors = %errorlimit
- abort
- end
- output "+++"
- wait 4
- end
- until %ok = 1
-
- display \n
- # output "atm"\13
- # if ! [input 10 OK\n]
- # display "Modem is not responding"\n
- # abort
- # end
- # output "at"$modemsetup\13
- output $modemsetup\13
- if ! [input 10 OK\n]
- display "Modem is not responding"\n
- abort
- end
- # output "at"$modemsetup\13
- # output $modemsetup\13
-
- # input 10 OK\n
- #
- # send phone number
- #
- %dials = 0
- %ok = 0
- %errors = 0
- repeat
- if %dials = %diallimit
- display "** Dialing attempt limit of "%diallimit" reached **"\n
- display "** Increase limit in script or try later... **"\n
- abort
- end
- %dials = %dials + 1
- display "** Dialing at "$number". Attempt "%dials"/"%diallimit" **"\n
- if [outputecho 60 "atdt"$number\13]
- if ! [read 10 $talkback]
- %errors = %errors + 1
- display "** Connection timeout error "%errors"/"%errorlimit"."\n
- if %errors = %errorlimit
- display "** Error limit reached. Aborting... **"\n
- abort
- end
- else
- if copy( $talkback, 1, 7 ) = "CONNECT"
- %ok = 1
- else
- if $talkback = "BUSY"
- display "** Busy detected. Attempt "%dials"/"%diallimit". **"\n
- else
- if $talkback = "NO CARRIER"
- display "** Ring-through detected. Attempt "%dials"/"%diallimit".**"\n
- if %numberlock = 0
- if $number = $number1
- display "** Switching dial number from "$number" to "$number2".**"\n
- $number = $number2
- else
- display "** Switching dial number from "$number" to "$number1".**"\n
- $number = $number1
- end
- end
- end
- end
- display "** Redialing... **"\n
- end
- end
- else
- %errors = %errors + 1
- display "** Dialing timeout error "%errors"/"%errorlimit"."\n
- if %errors = %errorlimit
- display "** Error limit reached. Aborting... **"\n
- abort
- end
- end
- until %ok
-
- input 60 \n
-
- wait 60 dcd
- #
- # wait for the username prompt
- #
- while ![input 5 $userprompt]
- output \n
- end
- output $username\13
-
-
-
- #input 30 $userprompt
- #output $username\13
- #
- # and the password
- #
- input 30 $passprompt
- output $password\13
- #
- if [input 60 "%"]
- output $slipcmd\13
- address 30
- # input 60 \n
- display \n"** Connection confirmed, IP address: "\i" **"\n
- online
- else
- display \n"** Connection not confirmed! Aborting... **"\n
- abort
- end
- #
- #
- # now we are finished.
- #
-
-
-
-